> library(data.table)
data.table 1.14.0 using 1 threads (see ?getDTthreads). Latest news: r-datatable.com
**********
This installation of data.table has not detected OpenMP support. It should still work but in single-threaded mode.
This is a Mac. Please read https://mac.r-project.org/openmp/. Please engage with Apple and ask them for support. Check r-datatable.com for updates, and our Mac instructions here: https://github.com/Rdatatable/data.table/wiki/Installation. After several years of many reports of installation problems on Mac, it's time to gingerly point out that there have been no similar problems on Windows or Linux.
**********
> year<-rep(c(2012:2015), each=12000000)
> month<-rep(rep(c(1:12), each=1000000), 4)
> value<-runif(48000000)
> DataFrame<-data.frame(year, month, value)
> DataTable<-as.data.table(DataFrame)
> system.time(DataFrame[DataFrame$year==2012, ])
user system elapsed
0.556 0.116 0.702
> system.time(DataTable[DataTable$year==2012, ])
user system elapsed
0.234 0.074 0.317
# 칼럼이 키 값으로 설정된 경우 자동 오름차순 정렬
> setkey(DataTable, year)
# 키 값으로 설정된 칼럼과 J 표현식을 사용한 검색 시간 측정
> system.time(DataTable[J(2012)])
user system elapsed
0.282 0.015 0.298